#!/usr/bin/ python
#author : Givemefivw
#Version: 0.1

# 主程序入口，从plugins文件夹调用相关配置文件

import argparse
from requests.api import options
from plugins.config import config_mode
from plugins.config import config_check
from plugins.payload.hostfile import host_file,url_file
from plugins.payload.fofasearch import fofa
from plugins.thridmode import PoCsearch



def banner():
    banner = """
 __      __      ___.   ___________           
/  \    /  \ ____\_ |__ \_   _____/______  ___
\   \/\/   // __ \| __ \ |    __)/  _ \  \/  /
 \        /\  ___/| \_\ \|     \(  <_> >    < 
  \__/\  /  \___  >___  /\___  / \____/__/\_ \\
       \/       \/    \/     \/             \/
                                                   
                                ———— 白日梦
            Author : givemefivw
            Github : https://github.com/givemefivw
            Version: 0.1                               
    """
    print(banner)


def main():
    parser = argparse.ArgumentParser(description='WebFoxScanner Help')
    parser.add_argument('-mode','--choose_mode',help='use -mode list to show all mode',default='')
    parser.add_argument('-u','--url',help='target url',default='')
    parser.add_argument('-host','--host',help='host',default='')
    parser.add_argument('-uf','--urlfile',help='urlfile',default='')
    parser.add_argument('-hf','--hostfile',help='hostfile',default='')
    parser.add_argument('-y','--year',help='cve-year',default='')
    parser.add_argument('-c','--cve',help='cve-number',default='')
    parser.add_argument('-fofa','--fofasearch',help='fofasearch',default='')
    parser.add_argument('-page','--fofapage',help='fofapage',default='1')
    parser.add_argument('-size','--fofasize',help='fofasize',default='100')
    args = parser.parse_args()


    if args.url:
        url = args.url
        mode = args.choose_mode
        if url.find('http') == -1:
                url = 'http://' + url + '/'
        #config_mode.choose_mode(mode,url)
        #config_check.checkvul(url)
    if args.host:
        host = args.host
        config_check.check_unanth(host)
    if args.hostfile:
        hostfile = args.hostfile
        host_file.scan_host_file(hostfile)
    if args.urlfile:
        urlfile = args.urlfile
        url_file.scan_url_file(urlfile)
    if args.fofasearch:
        fofasearch = args.fofasearch
        page = args.fofapage
        size = args.fofasize
        fofa(fofasearch,page,size)
    if args.choose_mode:
        mode = args.choose_mode
        url = args.url
        config_mode.choose_mode(mode,url)

    if args.year and args.cve:
        year = args.year
        cve = args.cve
        PoCsearch.monitor(year,cve)

        


if __name__ == '__main__':
    banner()
    main()
    





        



    









